{ INFORMATICS.MCCME.RU
  Problem statement: http://informatics.mccme.ru/moodle/mod/statements/view3.php?chapterid=1096
  Verdict: Accepted
}
uses sysutils;
var a,b:longint; s:string;
begin
assign(input,'input.txt');
assign(output,'output.txt');
reset(input);
rewrite(output);
read(a,b);
s:=floattostr(a/b);
if pos('.',s)=0 then write(0) else write(s[pos('.',s)+1]);
end.